Skip to content

feat(ci): validate issue template label references#623

Open
jyotsnak1603 wants to merge 3 commits into
utksh1:mainfrom
jyotsnak1603:fix-579-label-validation
Open

feat(ci): validate issue template label references#623
jyotsnak1603 wants to merge 3 commits into
utksh1:mainfrom
jyotsnak1603:fix-579-label-validation

Conversation

@jyotsnak1603
Copy link
Copy Markdown

Description

This PR adds automated validation for issue template label references and aligns existing issue templates with the repository's active label taxonomy.

Changes included:

  • Updated issue template labels to use the active taxonomy (type:*, area:*, priority:*)
  • Added scripts/validate_issue_template_labels.py to validate issue template label references
  • Added CI integration to automatically fail when invalid labels are referenced
  • Added maintainer guidance in CONTRIBUTING.md for updating issue template labels

Related Issues

Fixes #579

Type of Change

  • Documentation update
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Ran:
py -3.11 scripts/validate_issue_template_labels.py
  • Verified that all current issue templates pass validation.
  • Confirmed that the CI workflow executes the validation script.
  • Checked that updated template labels match the active repository taxonomy.

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

Copilot AI review requested due to automatic review settings June 5, 2026 21:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a CI-enforced validation step to ensure GitHub issue templates only reference an approved set of repository labels.

Changes:

  • Introduces a Python script to scan issue templates and flag unknown/deprecated labels.
  • Updates issue templates to use the new label taxonomy (type:*, area:*, priority:*).
  • Adds a GitHub Actions CI job and contributing docs guidance for running the validator.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
scripts/validate_issue_template_labels.py Implements label validation for issue templates against an allowlist.
CONTRIBUTING.md Documents the label taxonomy and how to run the validator locally/CI.
.github/workflows/ci.yml Adds a CI job intended to run the validator.
.github/ISSUE_TEMPLATE/help_wanted_task.md Replaces deprecated help wanted label with taxonomy label(s).
.github/ISSUE_TEMPLATE/feature_request.md Replaces deprecated feature label with type:feature.
.github/ISSUE_TEMPLATE/documentation_task.md Replaces deprecated documentation label with type:docs,area:docs.
.github/ISSUE_TEMPLATE/bug_report.md Replaces deprecated bug label with type:bug.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +46 to +54
issue-template-label-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Validate issue template labels
run: python scripts/validate_issue_template_labels.py
"level:advanced",
}

TEMPLATE_DIR = Path(".github/ISSUE_TEMPLATE")
Comment on lines +30 to +31
for template in TEMPLATE_DIR.glob("*.md"):
content = template.read_text(encoding="utf-8")

errors = []

for template in TEMPLATE_DIR.glob("*.md"):

for template in TEMPLATE_DIR.glob("*.md"):
content = template.read_text(encoding="utf-8")
match = re.search(r"^labels:\s*(.+)$", content, re.MULTILINE)
if not match:
continue

labels = [label.strip() for label in match.group(1).split(",") if label.strip()]
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot merge in its current form.

#606 has already merged the issue-template label taxonomy updates, and this PR now conflicts with current main (mergeable: CONFLICTING, mergeStateStatus: DIRTY). It also re-edits the same issue templates with slightly different label values, so merging it as-is would duplicate/overwrite the just-merged taxonomy work.

Please rebase on latest main and narrow this PR to the validation script, CI job, and CONTRIBUTING guidance only. Keep the already-merged template labels from main unless there is a specific reason to change them again. After conflicts are resolved and CI is green, I can re-review.

@utksh1 utksh1 added level:intermediate 35 pts difficulty label for moderate contributor PRs type:devops DevOps or infrastructure work category bonus label area:ci CI, tooling, or automation work type:docs Documentation work category bonus label labels Jun 5, 2026
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the latest head. This is still blocked because it overlaps the issue-template label changes already merged in #606 and should be narrowed to only the validation script, CI job, and CONTRIBUTING guidance. Please rebase on latest main and keep the already-merged template labels from main unless a specific additional change is needed.

@jyotsnak1603 jyotsnak1603 force-pushed the fix-579-label-validation branch from c98ed7f to a6c6ff2 Compare June 5, 2026 21:55
@jyotsnak1603
Copy link
Copy Markdown
Author

Hi @utksh1,

Thank you for the review.

I rebased the branch on the latest main, resolved the conflicts, and removed the issue template taxonomy changes that had already been merged separately.

The PR now focuses only on:

  • Issue template label validation script
  • CI validation workflow
  • CONTRIBUTING.md guidance

All CI checks are passing successfully.

Please let me know if any further changes are required. Thank you.

Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed after the latest update and branch refresh. The PR is now scoped to the validation script, CI job, and CONTRIBUTING guidance; checks are green, so this is good to merge.

@utksh1 utksh1 added the gssoc:approved Admin validation: approved for GSSoC scoring label Jun 5, 2026
@utksh1
Copy link
Copy Markdown
Owner

utksh1 commented Jun 5, 2026

Approved after the latest update and fresh green CI. Manual merge is blocked by repository branch policy, and GitHub auto-merge is disabled for this repository, so I am leaving this approved instead of using admin bypass.

@jyotsnak1603
Copy link
Copy Markdown
Author

Hi @utksh1,

Thank you for the approval.

I noticed the PR is still open due to the repository branch policy restrictions mentioned earlier. Just following up to check if there is anything further needed from my side to help move it forward.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, tooling, or automation work gssoc:approved Admin validation: approved for GSSoC scoring level:intermediate 35 pts difficulty label for moderate contributor PRs type:devops DevOps or infrastructure work category bonus label type:docs Documentation work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] Fail issue-template validation when referenced labels do not exist

3 participants